package com.heima.wemedia.controller.v1;


import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.CommentDto;
import com.heima.model.wemedia.dtos.CommentRepayDto;
import com.heima.model.wemedia.dtos.ManageDto;
import com.heima.wemedia.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/v1/comment/manage")
public class ManageController {


    @Autowired
    private ManageService manageService;

    //@PostMapping("/find_news_comments")
    public PageResponseResult manage(@RequestBody ManageDto dto) {
        return manageService.manage(dto);
    }

    //@PostMapping("/update_comment_status")
    public ResponseResult updateStatus(@RequestBody CommentDto dto) {
        return manageService.updateStatus(dto);
    }

    /**
     * @description: 查看文章的评论列表
     * @param: dto
     * @return: com.heima.model.common.dtos.ResponseResult
     * @author: liyong
     * @date: 2023/06/29 14:40
     */
    @PostMapping("/list")
    public ResponseResult list(@RequestBody CommentDto dto) {
        return manageService.list(dto);
    }

    /**
     * @description: 查看评论回复
     * @param: dto
     * @return: com.heima.model.common.dtos.ResponseResult
     * @author: liyong
     * @date: 2023/06/29 15:44
     */
    @PostMapping("/comment_repay")
    public ResponseResult commentRepay(@RequestBody CommentRepayDto dto) {
        return manageService.commentRepay(dto);
    }
}
